package models

import "time"

// EventType 定义事件类型
type EventType string

const (
	KeyPressEvent       EventType = "key_press"
	AppSwitchEvent      EventType = "app_switch"
	NetworkTrafficEvent EventType = "network_traffic"
)

// Event 基础事件结构
type Event struct {
	Type      EventType  `json:"type"`
	Timestamp time.Time `json:"timestamp"`
	Data      interface{} `json:"data"`
}

// KeyPressEventData 按键事件数据
type KeyPressEventData struct {
	KeyName string `json:"key_name"`
	Count   int    `json:"count"`
}

// AppSwitchEventData 窗口切换事件数据
type AppSwitchEventData struct {
	SourceAppName     string `json:"source_app_name,omitempty"`
	SourceWindowTitle string `json:"source_window_title,omitempty"`
	TargetAppName     string `json:"target_app_name"`
	TargetWindowTitle string `json:"target_window_title"`
	ExePath          string `json:"exe_path"`
}

// NetworkTrafficEventData 网络流量事件数据
type NetworkTrafficEventData struct {
	UploadDelta   float64 `json:"upload_delta"`
	DownloadDelta float64 `json:"download_delta"`
}